﻿using System.Collections.Generic;

namespace IcicleFramework.Actions
{
    public abstract class CompositeGameAction : GameAction
    {
        protected List<IGameAction> actions;

        public CompositeGameAction()
        {
            actions = new List<IGameAction>();
        }

        protected CompositeGameAction(CompositeGameAction old)
            : base(old)
        {
            actions = new List<IGameAction>();
            
            foreach (var action in old.actions)
            {
                actions.Add(action.DeepClone());
            }
        }

        public void AddAction(IGameAction action)
        {
            actions.Add(action);
        }

        public void RemoveAction(IGameAction action)
        {
            actions.Remove(action);
        }
    }
}
